<%--index.jsp--%>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>index.jsp</title>
</head>
<body>
this is jsp!

<%--JSP声明脚本 BEGIN--%>
<%!
    private int id;
    private String name;
    private double age;
    private static Map<String, String> map;
%>

<%!
    static {
        map = new HashMap<String, String>();
        map.put("name", "ylaihui");
        map.put("age", "3");
    }
%>
<%!
    public static int fun(int a, int b) {
        return a + b;
    }
%>

<%!
    public static class innerA {
        private int age;
        private String name;
    }
%>
<%--JSP声明脚本 END--%>

<%--JSP表达式脚本 BEGIN--%>
<%=11 %> <br>
<%=11.11 %> <br>
<%="ylaihui's" %> <br>
<%=map%> <br>
<%=request.getParameter("user")%><br>
<%--JSP表达式脚本 END--%>

<%--JSP的代码脚本 BEGIN--%>
<%
    int i = 10;
    if (i != 0)
        System.out.println("i != 0");
%>

<%
    for (int j = 0; j < 10; j++) {
        System.out.println(j);
    }
%>

<%
    String user = request.getParameter("user");
    System.out.println(user);
%>

<table border="1" cellpadding="0">

    <%
        for (int j = 0; j < 10; j++) {
    %>
    <tr>
        <td>第 <%=j + 1%> 行</td>
    </tr>
    <%
        }
    %>

</table>


<%--JSP的代码脚本 END--%>

</body>
</html>
